package com.tencent.mapper;

import com.tencent.entity.CheckGroup;
import com.tencent.entity.SetMeal;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

public interface SetMealMapper {
     /**
      * 新增套餐
      * @param setMeal
      * @return
      */
     @Insert("insert into t_setmeal(id,name,code,helpCode,sex,age,price,remark,attention) values (#{id},#{name},#{code},#{helpCode},#{sex},#{age},#{price},#{remark},#{attention})")
     int add(@RequestBody(required = false) SetMeal setMeal);

     /**
      * 查询所有套餐
      * @return
      * @param
      */
     @Select("select * from t_setmeal")
     public List<SetMeal> findAll();

     /**
      * 动态查询
      * @param code
      * @return
      */

     List<SetMeal> findByCode(String code);



     @Delete("delete from t_setmeal where code =#{code}")
     public int deleteByCode(String code);


     /**
      * 更改编剧数据
      */
     @Update({"update t_setmeal set code = #{code} , name = #{name},helpCode = #{helpCode}, sex = #{sex}, remark = #{remark}, attention = #{attention} where id={id}"})
     int updateSetmeal(SetMeal setMeal);
}
